package my.mall.front.api.util

import my.mall.common.bean.JsonParser

object SpecUtils {
    fun parseSpec(jsonParser: JsonParser?, specDetail: String?): String {
        val groupList = jsonParser!!.parseJsonToJsonNode(specDetail)
        val specSb = StringBuilder()
        for (specGroup in groupList) {
            specSb.append(specGroup["attrName"].asText()).append(": ").append(specGroup["itemName"].asText())
                .append(" ")
        }
        return specSb.substring(0, specSb.length - 1)
    }
}
